﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using ViewMaker;
using ViewMaker.Core;
using ViewMaker.Core.Controls;

namespace CloudStorageLight.WpfClient
{
    [View(typeof(ShowUrlWindow))]
    public class ShowUrlVM : ViewModelBase
    {
        [View(ViewControlType.TextBox)]
        [ViewProperty(TextBoxViewControl.Properties.IsReadOnly,true)]
        public string Url { get; set; }

        public double FontSize { get; set; }

        public string EncodeUrl
        {
            get { return string.Join("/", Url.Split('/').Select(x => Uri.EscapeDataString(x))); }
        }
        public ICommand CloseCommand
        {
            get
            {
                return CreateCommand((x) =>
                {
                    this.ExecuteViewCommand(ViewCommands.Close);
                });
            }
        }
    }
}
